package drinkshop;

import java.util.Scanner;

/**
 * @Auther: fei
 * @Date: 2021/6/6 - 06 - 06 - 10:26
 * @Description: drinkshop
 * @version: 1.0
 */
public class DrinkStore {
    public static Drink getDrink(int choice){
        Scanner sc = new Scanner(System.in);
        Drink d = null;
        switch(choice){
            case 1:
            {
                System.out.println("请录入可乐的名字：");
                String name = sc.next();
                System.out.println("请录入可乐的价格：");
                double price = sc.nextDouble();
                System.out.println("请录入可乐的规格：");
                String size = sc.next();
                System.out.println("请录入备注：");
                String remark = sc.next();
                System.out.println("请录入是否需要加冰：");
                String isIce = sc.next();
                System.out.println("请录入购买的数量：");
                int num = sc.nextInt();
                System.out.println("请选择可乐的品牌：");
                String brand = sc.next();
                //将录入的信息封装为可乐的对象：
                Cola cola = new Cola("可乐",price,size,remark,isIce,num,brand);
                d = cola;
            }
            break;
            case 2:
            {
                System.out.println("请录入咖啡的名字：");
                String name = sc.next();
                System.out.println("请录入咖啡的价格：");
                double price = sc.nextDouble();
                System.out.println("请录入咖啡的规格：");
                String size = sc.next();
                System.out.println("请录入备注：");
                String remark = sc.next();
                System.out.println("请录入是否需要加冰：");
                String isIce = sc.next();
                System.out.println("请录入购买的数量：");
                int num = sc.nextInt();
                System.out.println("请选择是否需要加糖、加奶或者都不加：");
                String append = sc.next();
                //将录入的信息封装为可乐的对象：
                Coffee coffee = new Coffee("咖啡",price,size,remark,isIce,num,append);
                d = coffee;
            }
            break;
            case 3:
            {
                System.out.println("请录入奶茶的名字：");
                String name = sc.next();
                System.out.println("请录入奶茶的价格：");
                double price = sc.nextDouble();
                System.out.println("请录入奶茶的规格：");
                String size = sc.next();
                System.out.println("请录入备注：");
                String remark = sc.next();
                System.out.println("请录入是否需要加冰：");
                String isIce = sc.next();
                System.out.println("请录入购买的数量：");
                int num = sc.nextInt();
                System.out.println("请备注奶茶中是否加入椰果、红豆、布丁：");
                String append = sc.next();
                //将录入的信息封装为可乐的对象：
                MilkyTea milkyTea = new MilkyTea("奶茶",price,size,remark,isIce,num,append);
                d = milkyTea;
            }
            break;
        }
        return d;
    }
}
